import { resolve } from "path";
import uni from "@dcloudio/vite-plugin-uni";
import { defineConfig } from "vite";
import tinyfy from "vite-plugin-tinyfy";

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    open: true,
  },
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
  },
  define: {
    "process.env": {
      NODE_ENV: process.env.NODE_ENV,
    },
  },
  plugins: [
    uni(),
    tinyfy({
      pass: process.env.NODE_ENV == "development",
    }),
  ],
});
